package com.kaifamiao.N0811;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Node2 {
    public static void main(String[] args) {
        String[] arr = new String[]{"Java", "Java虚拟机", "Java中文社群"};
        for (int i = 0; i < arr.length; i++) {
            String item = arr[i];
            System.out.println(item);
        }

        List<String> list = new ArrayList<String>() {{
            add("Java");
            add("Java虚拟机");
            add("Java中文社群");
        }};
        for (int i = 0; i < list.size(); i++) {
            String item = list.get(i);
            System.out.println(item);
        }

        Iterator iterator = list.iterator();

        while (iterator.hasNext()) {
            Object object = iterator.next();
            System.out.println(object);

        }
    }
}
